------------------------------------------------------------------------------------------------------------------------------------ name: log: C:\Projects\Analysis\Calendar tutorial\Stata\Example8.log log type: text opened on: 31 Aug 2017, 00:30:56 . do Example`x'.do . * DHS Calendar Tutorial - Example 8 . * Reason for discontinuation in the last five years by method. . . * change to a working directory where the data are stored . * or add the full path to the 'use' command below . cd "C:\Data\DHS_model" C:\Data\DHS_model . . * open the events file dataset created by the 'create events file.do' . use "eventsfile.DTA", clear . . * weight variable . gen wt = v005/1000000 . . * recode the methods to group methods together . recode ev902 /// > (1=1 "Pill") /// > (2=2 "IUD") /// > (3=3 "Injection") /// > (11=4 "Implants") /// > (5=5 "Male condom") /// > (13=6 "LAM") /// > (nonmissing = 10 "Other") /// > (missing=.), g(method) (30112 differences between ev902 and method) . * Other includes: Female Sterilization, Male sterilization, Other Traditional, Female Condom, . * Emergency contraception, Other Modern, Standard Days Method, . * Periodic Abstinence and Withdrawal . label var method "Contraceptive method" . . * tabulate all discontinuations that occurred within the last five years . tab ev903 method [iw=wt] if ev903 != 0 & v008-ev901 < 60, col +-------------------+ | Key | |-------------------| | frequency | | column percentage | +-------------------+ | Contraceptive method Discontinuation code | Pill IUD Injection Implants Male cond LAM Other | Total ----------------------+-----------------------------------------------------------------------------+---------- Became pregnant while | 36.963059 0 23.518104 0 5.482217 4.193065 12.798515 | 82.95496 | 9.14 0.00 4.88 0.00 4.46 6.12 18.55 | 6.56 ----------------------+-----------------------------------------------------------------------------+---------- Wanted to become preg | 119.70253 5.4144591 131.53668 22.7654323 34.493693 9.621027 16.03057 | 339.56439 | 29.61 19.48 27.29 25.05 28.08 14.05 23.23 | 26.84 ----------------------+-----------------------------------------------------------------------------+---------- Husband disapproved | 14.03721 .88217503 6.508606 4.665788 9.5084161 27.966215 2.05095 | 65.61936 | 3.47 3.17 1.35 5.13 7.74 40.85 2.97 | 5.19 ----------------------+-----------------------------------------------------------------------------+---------- Side effects | 97.680173 20.23361 233.75634 54.539657 6.1060832 2.472669 9.3941112 | 424.18264 | 24.16 72.81 48.50 60.00 4.97 3.61 13.61 | 33.53 ----------------------+-----------------------------------------------------------------------------+---------- Access/availability | 21.212403 0 5.54250896 0 2.688849 0 .55186999 | 29.995631 | 5.25 0.00 1.15 0.00 2.19 0.00 0.80 | 2.37 ----------------------+-----------------------------------------------------------------------------+---------- Wanted more effective |80.5512978 0 35.99295 .418383 26.714048 1.731912 14.697614 | 160.10621 | 19.93 0.00 7.47 0.46 21.75 2.53 21.30 | 12.65 ----------------------+-----------------------------------------------------------------------------+---------- Inconvenient to use | 8.344504 1.25802 6.075892 3.9752231 18.158897 0 1.814087 | 39.626623 | 2.06 4.53 1.26 4.37 14.78 0.00 2.63 | 3.13 ----------------------+-----------------------------------------------------------------------------+---------- Infrequent sex/husban | 5.2058952 0 14.48474 0 1.208572 6.3403819 7.5512051 | 34.790794 | 1.29 0.00 3.01 0.00 0.98 9.26 10.94 | 2.75 ----------------------+-----------------------------------------------------------------------------+---------- Cost | .286632 0 5.827325 2.7108791 4.8573129 0 0 | 13.682149 | 0.07 0.00 1.21 2.98 3.95 0.00 0.00 | 1.08 ----------------------+-----------------------------------------------------------------------------+---------- Fatalistic | 0 0 .73194402 0 0 10.373286 0 | 11.10523 | 0.00 0.00 0.15 0.00 0.00 15.15 0.00 | 0.88 ----------------------+-----------------------------------------------------------------------------+---------- Difficult to get preg | .53772801 0 1.14783597 .563108027 0 0 0 | 2.248672 | 0.13 0.00 0.24 0.62 0.00 0.00 0.00 | 0.18 ----------------------+-----------------------------------------------------------------------------+---------- Other | .56567502 0 5.295249 0 0 0 1.766301 | 7.6272251 | 0.14 0.00 1.10 0.00 0.00 0.00 2.56 | 0.60 ----------------------+-----------------------------------------------------------------------------+---------- Missing | 19.161202 0 11.523261 1.25802 13.622675 5.76505208 2.356418 | 53.686628 | 4.74 0.00 2.39 1.38 11.09 8.42 3.41 | 4.24 ----------------------+-----------------------------------------------------------------------------+---------- Total | 404.24831 27.788264 481.94143 90.8964901 122.84076 68.463608 69.011642 | 1,265.191 | 100.00 100.00 100.00 100.00 100.00 100.00 100.00 | 100.00 . end of do-file . log close name: log: C:\Projects\Analysis\Calendar tutorial\Stata\Example8.log log type: text closed on: 31 Aug 2017, 00:30:56 ------------------------------------------------------------------------------------------------------------------------------------